package kaist.sep521.lego.circlebicycle;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.widget.VideoView;

public class IntroActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_intro);

		Thread introThread = new Thread() {
			public void run() {
				try {
					sleep(4000);

					Intent intent = new Intent(getBaseContext(), MainActivity.class);
					startActivity(intent);
				} catch (InterruptedException e) {
					e.printStackTrace();
				} finally {
					finish();
				}
			}
		};
		introThread.start();

		VideoView video = (VideoView)findViewById(R.id.videointro); 
		Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.intro);
		video.setVideoURI(videoUri);
		video.start();
	}
}
